package com.webchat.common.enums.payment;


import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

@Getter
@AllArgsConstructor
public enum PaymentBusinessActionEnum {


    MALL_PRODUCT_ORDER("MALL_PRODUCT_ORDER", "WEBCHAT_UGC", "商城商品订单支付事件");

    private final String action;
    private final String server;
    private final String actionName;


    public static PaymentBusinessActionEnum getByAction(String action) {
        if (StringUtils.isBlank(action)) {
            return null;
        }
        for (PaymentBusinessActionEnum paymentBusinessActionEnum : PaymentBusinessActionEnum.values()) {
            if (paymentBusinessActionEnum.getAction().equals(action)) {
                return paymentBusinessActionEnum;
            }
        }
        return null;
    }
}
